/* 登录弹窗样式 */

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.modal-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 28rem;
    width: 100%;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: none;
    transition: none;
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    color: #9ca3af;
    transition: color 0.2s ease;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.modal-close:hover {
    color: #6b7280;
    background-color: #f3f4f6;
}

/* 弹窗内容 */
.modal-content {
    padding: 1.5rem;
    transform: none !important;
    animation: none !important;
    transition: none !important;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background-color: #ffffff;
}

.form-input:hover {
    border-color: #9ca3af;
}

.form-input::placeholder {
    color: #9ca3af;
}

/* 带图标的输入框 */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
    z-index: 1;
}

.form-input-with-icon {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-input-with-icon:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background-color: #ffffff;
}

.input-with-icon:focus-within .input-icon,
.password-container-with-icon:focus-within .input-icon {
    color: #3b82f6;
}

.form-input-with-icon:hover {
    border-color: #9ca3af;
}

.form-input-with-icon::placeholder {
    color: #9ca3af;
}

/* 密码输入框 */
.password-container {
    position: relative;
}

.password-container-with-icon {
    position: relative;
}

.password-container-with-icon .form-input-with-icon {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.25rem;
    z-index: 2;
}

.password-toggle:hover {
    color: #6b7280;
}

/* 记住我和忘记密码 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.checkbox-input {
    border-radius: 0.25rem;
    border-color: #d1d5db;
    color: #3b82f6;
}

.checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
}

.checkbox-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.forgot-link {
    font-size: 0.875rem;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #2563eb;
}

/* 登录按钮 */
.login-button {
    width: 100%;
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.login-button:hover:not(:disabled) {
    background-color: #2563eb;
}

.login-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 分割线 */
.divider {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #d1d5db;
}

.divider-text {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* 注册链接 */
.register-section {
    text-align: center;
}

.register-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.register-link {
    font-size: 0.875rem;
    color: #3b82f6;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

.register-link:hover {
    color: #2563eb;
}

/* 加载状态 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .modal-container {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-content {
        padding: 1rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* 防止背景滚动 */
body.modal-open {
    overflow: hidden;
}
